﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using GameControl;
[RequireComponent(typeof(Rigidbody2D))]
public class ItemRigidBody2D : MonoBehaviour
{
    private void OnCollisionEnter2D(Collision2D collision)
    {
        if (GameManager.Get<IItemHealthManager>().CheckIfCanCollide(collision.otherCollider.GetItemName(),
            collision.collider.GetItemName()))
            GameControl.GameManager.Get<GameControl.IPhysicalDamageManager>().OnCollisionHappen(collision.otherCollider.GetItemName(),
                collision.collider.GetItemName(), collision.GetImpactForce());
        //       Debug.Log(collision.otherCollider.transform.parent.name);
    }
}
